﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class quantri_Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //kiểm tra cài đặt
        //Author: Nguyễn Huỳnh Y
        DataClassesDataContext db = new DataClassesDataContext();
        int i = 1;
        if (Session["Username"] == null)
        {
            Response.Redirect("Login.apsx");
        }
        else
        {
            var account = from acc in db.Accounts where acc.Acc_username == Session["Username"].ToString() select acc;
            if (account.Count() > 0)
            {
                var user = account.FirstOrDefault();
                lbStt.Text = i++.ToString();
                lbAccName.Text = user.Acc_fullname;
                lbAccUserName.Text = user.Acc_username;
                var permiss = (from per in db.Permissions 
                              where per.Per_id == user.Per_id select per).Single();
                lblPerDis.Text = permiss.per_description;
            }
        }
    }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {

    }
}
